<template>
  <div>
    <el-form label-position="right" label-width="80px" size="small">
      <el-form-item label="是否显示">
        <el-switch v-model="yAxis.show" @change="(val)=>{return this.handleChange(val,'yAxis.show')}"></el-switch>
      </el-form-item>
      <el-form-item label="坐标轴轴线颜色">
        <el-color-picker v-model="yAxis.axisLine.lineStyle.color"
                         @change="(val)=>{return this.handleChange(val,'yAxis.axisLine.lineStyle.color')}"></el-color-picker>
      </el-form-item>
      <el-form-item label="坐标轴轴线类型">
        <el-select v-model="yAxis.axisLine.lineStyle.type"
                   @change="(val)=>{return this.handleChange(val,'yAxis.axisLine.lineStyle.type')}">
          <el-option value="solid" label="solid"></el-option>
          <el-option value="dashed" label="dashed"></el-option>
          <el-option value="dotted" label="dotted"></el-option>
        </el-select>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
import {mapMutations} from 'vuex'

export default {
  name: "Index",
  data() {
    return {}
  },
  computed: {
    yAxis() {
      return this.$store.getters.getOption('yAxis');
    }
  },
  methods: {
    ...mapMutations([
      'setOption',
    ]),
    handleChange(value, path) {
      return this.setOption({path, option: value})
    }
  }

}
</script>

<style scoped>

</style>